home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-02-07 | 1.5 KB | 70 lines | [TEXT/MPS ] |
- (*
- CTBBreak [ticks] -- Issue a break for ticks 60ths of a second; if ticks is left off, issue a break for
- three seconds.
-
- To compile and link this file using Macintosh Programmer's Workshop,
-
- pascal -w CTBBreak.p
- link -m ENTRYPOINT -o HyperCommands -rt XCMD=2761 -sn Main=CTBBreak ∂
- CTBBreak.p.o "{MPW}"Libraries:interface.o "{MPW}"Libraries:Libraries:HyperXLib.o
-
- © Copyright 1990 by Apple Computer, Inc.
-
- Initial coding 2/90 by Harry R. Chesley.
- *)
-
- {$R-}
-
- {$S CTBBreak } { Segment name must be the same as the command name. }
-
- unit DummyUnit;
-
- interface
-
- uses MemTypes, QuickDraw, OSIntf, ToolIntf, CTBUtils, FTIntf, CMIntf, TMIntf, CRMIntf, HyperXCmd;
-
- procedure EntryPoint(paramPtr: XCmdPtr);
-
- implementation
-
- procedure CTBBreak(paramPtr: XCmdPtr); forward;
-
- procedure EntryPoint(paramPtr: XCmdPtr);
-
- begin
- CTBBreak(paramPtr);
- end;
-
- procedure CTBBreak(paramPtr: XCmdPtr);
-
- {$I CTBUtil.inc}
-
- var ticks: longInt;
-
- procedure Fail(errMsg: Str255); { set theResult and quit }
- begin
- paramPtr^.returnValue := PasToZero(paramPtr,errMsg);
- exit(CTBBreak);
- end;
-
- begin
- { Check the number of parameters. }
- if paramPtr^.paramCount > 1 then Fail('Invalid parameter count');
-
- { Figure out how long to break for. }
- if ParmPresent(1) then ticks := GetLongParm(1)
- else ticks := 180;
-
- { Make sure the Comm Toolbox is present. }
- CTBReady;
- { And a connection tool is here. }
- EnsurePresent(connectionTool);
- { And open. }
- EnsureOpen;
-
- { Break. }
- CMBreak(Globals^^.connHand,ticks,false,nil);
- end;
-
- end.
-